home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programmer Power Tools
/
Programmer Power Tools.iso
/
microcrn
/
issue_37.arc
/
PCDADS-1.FIG
< prev
next >
Wrap
Text File
|
2000-01-06
|
5KB
|
109 lines
100 REM PC-DADS Ver. 1.1 for two floppy drive system with NO hard disk
101 REM PCDADS1C.BAS 11/22/86 Russ Eberhart
110 CLS:KEY OFF:ST=0
120 PRINT:PRINT "PC DATA Acquisition, Display and Storage (PC-DADS) v. 1.1"
130 PRINT:PRINT "Copyright 1986, JHU Applied Physics Laboratory":PRINT
140 PRINT:PRINT "NOTE: This program version requires RAM disk on drive C"
150 PRINT " Data are recorded on diskette in drive B:"
160 PRINT:PRINT
170 PRINT "Connect first calibration voltage to all input channels, then press any key..."
180 IF INKEY$="" THEN 180
190 R1(1)=1/STICK(0):R1(2)=1/STICK(1):R1(3)=1/STICK(2):R1(4)=1/STICK(3)
200 PRINT:PRINT "First set of calibration readings taken"
210 INPUT "Enter value in volts of first calibration voltage";V1:PRINT
220 PRINT "Connect second calibration voltage to all input channels, then press any key..."
230 IF INKEY$="" THEN 230
240 R2(1)=1/STICK(0):R2(2)=1/STICK(1):R2(3)=1/STICK(2):R2(4)=1/STICK(3)
250 PRINT:PRINT "Second set of calibration readings taken"
260 INPUT "Enter value in volts of second calibration voltage";V2
270 DV=V2-V1
280 FOR I=1 TO 4:F(I)=(R2(I)-R1(I))/DV:OF(I)=R2(I)-(V2*F(I))
300 NEXT
310 PRINT:PRINT "PC-DADS System is now calibrated"
320 PRINT:PRINT " ***** MAIN MENU *****"
330 PRINT:PRINT " 1. Four-channel data display, single screen at a time"
340 PRINT:PRINT " 2. Continuous four-channel data display"
350 PRINT:PRINT " 3. Acquire and record data set, display on screen;"
360 PRINT " saving to disk is then optional for each data set"
370 PRINT:PRINT " 4. Acquire and record data sets at selected intervals,"
380 PRINT " save to disk automatically"
390 PRINT:PRINT " 5. Execute SHELL command to operating system; type EXIT"
400 PRINT " to return to PC-DADS Main Menu"
410 PRINT
420 INPUT "Enter choice:";MC
430 ON MC GOTO 460, 450, 610, 880, 860
440 GOTO 320
450 ST=1
460 PRINT "Channels one and two will appear in the lower half of the screen,"
470 PRINT "Channels three and four will appear in the upper half."
480 PRINT "A beep will signal that a trace is complete; if you are in single"
490 PRINT "trace mode, you may then press any key to start another trace."
500 PRINT "Press CRTL-BRK to exit program."
510 PRINT:PRINT "Press any key to start data display..."
520 IF INKEY$="" THEN 520
530 GOSUB 2000
550 FOR I%=40 TO 639
560 PSET(I%,187-8*((1/STICK(0))-OF(1))/F(1)):PSET(I%,139-8*((1/STICK(1))-OF(2))/F(2)):PSET(I%,91-8*((1/STICK(2))-OF(3))/F(3)):PSET(I%,43-8*((1/STICK(3))-OF(4))/F(4))
570 NEXT
590 BEEP
600 IF INKEY$="" AND ST=0 THEN 600 ELSE 530
610 CLS:PRINT"Press any key to start taking data..."
620 IF INKEY$="" THEN 620 ELSE 630
630 CLS:PRINT"Taking data..."
640 OPEN "c:data.dat" FOR OUTPUT AS #1
650 PRINT #1, F(1);F(2);F(3);F(4);OF(1);OF(2);OF(3);OF(4)
660 T1$=TIME$
670 FOR I=1 TO 600
680 PRINT #1, STICK(0);STICK(1);STICK(2);STICK(3)
690 NEXT
700 T2$=TIME$:PRINT #1, DATE$,T1$,T2$
710 CLOSE
720 GOSUB 2000
730 OPEN "c:data.dat" FOR INPUT AS #1
740 INPUT #1, F1,F2,F3,F4,OF1,OF2,OF3,OF4
760 FOR I%=40 TO 639
770 INPUT #1, S0,S1,S2,S3
780 PSET(I%,187-8*((1/S0)-OF1)/F1):PSET(I%,139-8*((1/S1)-OF2)/F2):PSET(I%,91-8*((1/S2)-OF3)/F3):PSET(I%,43-8*((1/S3)-OF4)/F4)
800 NEXT
810 CLOSE:BEEP
820 LOCATE 1,1:INPUT"Do you want to save these data to diskette";SV$
830 IF SV$="Y" OR SV$="y" THEN 840 ELSE 610
840 SHELL "copy c:data.dat b:data.dat"
850 CLS:GOTO 320
860 SCREEN 0:SHELL
870 SCREEN 2:CLS:GOTO 320
880 CLS:INPUT "How many points per data set";PPS
890 PRINT:INPUT"How many data sets per day";DSD
900 OPEN "c:dataset.dat" FOR OUTPUT AS #1
910 PRINT #1, F(1);F(2);F(3);F(4);OF(1);OF(2);OF(3);OF(4);PPS;DSD
920 CLOSE:CLS
930 SHELL "copy c:dataset.dat b:dataset.dat"
940 CLS:PRINT "Press any key to take first data set"
950 IF INKEY$="" THEN 950 ELSE 960
960 CLS:OPEN "c:dataset.dat" FOR OUTPUT AS #1
970 TS$=TIME$:TS=TIMER:PRINT"Taking data..."
980 FOR I=1 TO PPS
990 PRINT #1, STICK(0);STICK(1);STICK(2);STICK(3)
1000 NEXT
1010 TE$=TIME$:PRINT #1, DATE$,TS$,TE$
1020 CLOSE:CLS:PRINT"Saving data to diskette file on drive B:"
1030 SHELL "copy b:dataset.dat+c:dataset.dat"
1040 CLS:PRINT"Waiting to take next data set..."
1050 TE=TIMER
1060 IF TE < TS THEN TE=TE+86400!
1070 IF TE-TS > 86400!/DSD THEN 960 ELSE 1050
2000 SCREEN 2:CLS
2010 FOR I=40 TO 639 STEP 30
2020 FOR J=195 TO 11 STEP -8:PSET(I,J)
2030 NEXT J:NEXT I
2040 K=25
2050 FOR H=1 TO 4
2055 BV=-2
2060 LOCATE K,1:PRINT H;:LOCATE K-1,2:PRINT "H";:LOCATE K-2,2:PRINT "C";
2070 FOR L=K TO K-5 STEP -1
2080 BV=BV+1:LOCATE L,3:PRINT BV;
2090 NEXT L
2100 K=K-6
2110 NEXT H
2120 RETURN